-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

=============================================================================
FreeBSD-EN-21:14.pms                                            Errata Notice
                                                          The FreeBSD Project

Topic:          pms(4) data corruption

Category:       core
Module:         pms
Announced:      2021-05-26
Affects:        FreeBSD 12.2 and later.
Corrected:      2021-04-23 01:05:42 UTC (stable/13, 13.0-STABLE)
                2021-05-26 19:30:23 UTC (releng/13.0, 13.0-RELEASE-p1)
                2021-04-23 01:11:07 UTC (stable/12, 12.2-STABLE)
                2021-05-26 20:40:15 UTC (releng/12.2, 12.2-RELEASE-p7)

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security
branches, and the following sections, please visit
<URL:https://security.FreeBSD.org/>.

I.   Background

pms(4) is a driver for PMC-Sierra disk controllers.

II.  Problem Description

Two problems are fixed by this update.

First, the pms(4) driver did not correctly handle the new kern.maxphys
value set in FreeBSD 13.0.  The devices supported by the driver impose a
limit on the maximum I/O size, and this limit is smaller than the new
default.

Second, the pms(4) driver did not correctly handle some error cases in
the I/O path and would falsely report success to upper layers.

III. Impact

The bugs may cause data corruption.

IV.  Workaround

No workaround is available.  Systems not using pms(4) are unaffected.

V.   Solution

Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date and reboot.

Perform one of the following:

1) To update your system via a binary patch:

Systems running a RELEASE version of FreeBSD on the amd64, i386, or
(on FreeBSD 13 and later) arm64 platforms can be updated via the
freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for an erratum update"

2) To update your system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 13.0]
# fetch https://security.FreeBSD.org/patches/EN-21:14/pms.13.patch
# fetch https://security.FreeBSD.org/patches/EN-21:14/pms.13.patch.asc
# gpg --verify pms.13.patch.asc

[FreeBSD 12.2]
# fetch https://security.FreeBSD.org/patches/EN-21:14/pms.12.patch
# fetch https://security.FreeBSD.org/patches/EN-21:14/pms.12.patch.asc
# gpg --verify pms.12.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile your kernel as described in
<URL:https://www.FreeBSD.org/handbook/kernelconfig.html> and reboot the
system.

VI.  Correction details

This issue is corrected by the corresponding Git commit hash or Subversion
revision number in the following stable and release branches:

Branch/path                             Hash                     Revision
- -------------------------------------------------------------------------
stable/13/                              6514cb18d94e    stable/13-n245322
releng/13.0/                            b62d492067ba  releng/13.0-n244736
stable/12/                                                        r369655
releng/12.2/                                                      r369861
- -------------------------------------------------------------------------

For FreeBSD 13 and later:

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:

<URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN>

To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:

# git rev-list --count --first-parent HEAD

For FreeBSD 12 and earlier:

Run the following command to see which files were modified by a particular
revision, replacing NNNNNN with the revision number:

# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base

Or visit the following URL, replacing NNNNNN with the revision number:

<URL:https://svnweb.freebsd.org/base?view=revision&revision=NNNNNN>

VII. References

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-EN-21:14.pms.asc>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE/A6HiuWv54gCjWNV05eS9J6n5cIFAmCu6uwACgkQ05eS9J6n
5cJZWg/8DEsOaseewourLWezA+HeV2aHfsNf96qa4O7oAOUGtCm7nKi7jodIiLB1
DiX8YqskrVav36lLxgyQazSCF84xB1YsNP4EiOzjeIoZyirR8+KiG37CunGhUDPg
8mPCE1+WBzHlcDwAEexldi+b88ehEqADbZiGWAsBcXYqhwaXoF6zUkgp5WFRWKzu
Kiq7Wjs7FGkAp38O4UKduybpubSyUjHCeShEGyZvevJQE4kAZKzv1+Q+spUeIBLP
P99p+vidIFIpX4uq0GgjF1GLuz4ym1tRZwu4jlJ0Vhr0KjqTWwxoMZ0m+0+SwKit
dqPLQ/rj1vBiCScU7rIS49wfT6vtujH9gPt4GI5mTY8++4hDkfRvS4D5we9RgIo+
0j3NIAf0cb47V6nPSOBwAqkFwjtGu7rhtGgmmp1Pmf0v8I/EqRCgIekexMVW294u
L9pyH3LalHqi/GcuMn8emTPiJ6+5a1e+EBKXtnoX5tJvenkSXAl6eV7BuETaaMOc
zvMheSzvcnn+h2jIA1Mizfv9BIglRNakIxzJpSxugQWTzAQ7PutzqSaLCsn9byp3
590cBmbmVdAFEuqIdz5I/d3BwpF24myNmYFtRlxT115jaOV8ta2qKg4GryMOCUL2
R+zE2+d1JT+/Ra1wm2vfWIUb1pPQUIIvQ8m2rGhiok0Nlc7C7O0=
=nfsk
-----END PGP SIGNATURE-----
